<?php
namespace FoxLib\Providers;

use Symfony\Component\Cache\Simple\RedisCache;

use Illuminate\Support\ServiceProvider;

class WechatCacheServiceProvider extends ServiceProvider
{

    public function register()
    {
        $this->app->singleton('easyWechatCache', function ($app) {
            $predis = $app['redis']->connection('wechat')->client(); // connection($name), $name 默认为 `default`
            return new RedisCache($predis);
        });
    }
}
